Search Results: "gris"

6 August 2008

Christian Perrier: Holidays report

Sure, that sounds fairly formal to send a report for holidays, doesn't it? Anyway, as I have a few (often Debian/FLOSS related) friends around the world who are reading my blog entries, this might interest them so that's indeed a report..:-)...and I have time for it, so... I'm currently going back from Cahors to Maurepas (home), on my way to Debconf. We spent 10 days in Cahors with Elizabeth and the girls, finally joined by Jean-Baptiste on Sunday. We had great time over there, enjoying the richness of Quercy: So, I'm now heading back home, assemble stuff and will take off for Debconf on Thursday 7th (Paris Orly to Madrid, then Buenos Aires via Air Europa: IIRC nobody from Debconf is in the same flight). "Assemble stuff" here also means collecting cheese for the now famous Debconf Cheese&Wine party. That one will be tricky to achieve as most of us are coming from quite far away and...there are only 6 French citizens who attend DC8..:-)). Anyway, I already know that my fellow Nicolas Fran ois (namely nominated as Assistance CheeseMaster recently) will bring some good stuff. I haven't decided yet what to bring. I might be influenced by my holidays, so cheeses from South-West France are highly probable. Cahors wine will be the choice (prepare yourself: that is strong stuff). At Debconf itself, we'll have a quite busy schedule. I intend to mostly work along with Felipe, Nicolas, Grisu and others on i18n.debian.net. I'll have to animate the i18n sessions for which I want to prepare some schedule instead of just "lat's gather and talk" which didn't work so well last year, IMHO. And I have that bloody keynote lecture which, BTW, could be rescheduled if I properly read debconf-discuss as, finally 9am for keynotes seems to be considered too early for the late birds at DC8...:-)... We'll see: I will certainly have something that's not very well cooked and prepared. Expect some improvisation: this year I didn't want to stress myself with a talk, slides and blahblah. Elizabeth will come back from Cahors on Saturday with the kids. She'll have a holiday week at her father's place whil ethe kids will....do their stuff at Maurepas (this is what happens when kids are grown up). We'll gather together again on Aug 18th and I go back to work on 19th. Crazy, I know but I have a very busy and full work schedule for the upcoming next 2 months. September will be a hard time to go through: Jean-Baptiste will start his "Licence Profesionnelle" in Automated and Embarked Systems. He'll do it in shared time: half-time at university for classes and half-time working in a company (which turns out to be Essilor, the world leader for progressive glasses....and the company which Elizabeth is working for). He'll stay at my sister-in-law place during the week (30km away from our place but closer from university and work). Sophie, our 18-year old daughter, will spend the year in Toulouse, to prepare the admission in a Social Workers school. She'll have her own apartment, in the very center of the city, 20 meters away from Place du Capitole. Annoying, isn't it ? :-) So, we'll mostly stay with our "little" Magali, our 16 y.o. who will be attending High School, on her way to Baccalaur at. Tell us about shrinking families.... Now time to work on some slides for the Debconf keynote. Damn.

26 May 2008

Neil Williams: Non-code code development upstream for estron

As well as choosing a licence, various other non-code or pseudo-code tasks are needed in all upstream projects and I have been working on some of these in my upstream project, estron.

  1. Documentation - Quietly converting the old docs (XML comments) into SGML (docbook content) for use with yelp. Comments have no particular structure so it takes time to add docbook structure to what was just a block of arbitrary text in comment tags.

  2. MIME - Not sure if I've got this right still - I don't see the icon for .estron files and I get a warning when trying to double-click on an "Estron file" (the file type is recognised but gets confused with the XML inside). I'm following code samples from grisbi and drivel to try and get things together.

  3. configuration support - estron will use dbconfig-common in Debian for the internal estron database but I need to set upstream to be able to read in the data created by dbconfig in a non-Debian-only manner, probably using GIO to provide configuration that can include a filename of external config data.

  4. cross build support - a few quibbles in that area but I'll sort them before release. Can help catch architecture-specific problems in the code that would cause a FTBFS on the Debian buildd system.



Other tasks already covered:



I have actually been doing some code too - in QOF due to a bug identified by testing and developing estron and in estron itself to bring 64bit time handling to estron and prevent time overflows in 2038 should you use estron on 32bit machines.

23 May 2008

Axel Beckert: Favourite Linux Desktop Applications

foosel tagged me, whatever that means. Perhaps it’s the English word for “Stöckchen” (German for “small stick”) of which I always wondered how the English blogging part of the blogosphere is calling that kind of coercing blog posts… ;-) So these are the rules:
  1. blog a list with your favorite desktop Linux software (as many or few you want)
  2. add links to the software project’s websites
  3. post these rules
  4. tag three other Linux using bloggers
Interestingly splitbrain, who started the thing just calls it “Meme”, but to me memes are the same thing just without duress. ;-) So you want to know about what Linux desktop software I like and use, hmm? Desktop means GUI, doesn’t it? There are only a few GUI application I really use often since, as you probably know, X is primarily a terminal multiplexer and screen resolutions are compared by how many 80×25 xterms with fixed font you can get on one screen without overlapping. ;-) But to be honest: Although I’m more the command line guy hacking cryptic lines into windows with small fonts, there are a few thing where I don’t want to miss X and the GUI applications: For all things web – that means web browser, feed reader, etc. But then there is also a bunch of GUI software I use occasionally or as alternative tool to some text mode or command line software. WebX / Desktop Environment
  • xtrlock – the simplest tool to lock you desktop: The mouse turns into a lock and it only goes away if you enter the right password. No screen saver included though and everyone can see what’s on your desk. I like it though. Use it on low-end machines.
  • XScreenSaver and Really Slick Screensavers (GLX Port) – Configurable and command controllable screen saver daemon. Favourite modes: GLMatrix and Substrate from XScreenSaver and Lattice Sky Rocket and Hufo’s Smoke from RSS GLX.
  • xosview – my favourite system monitor since more than a decade.
  • TerminalsAudio and VideoEditing and DevelopingGraphicsChatOther ToolsGamesNon-Desktop Applications In case someone wonders about my mail client, Jabber client, IRC client, ICQ client, file manager, notes taking application, shell and versioning system – they’re all command line or text-mode applications: Who’s next? That’s difficult: Hmmm, I think I have to look in a different corner of my circle of friends. Hmm. Ah, now I know: And no, I don’t expect posts as comprehensive as mine. :-)

    18 May 2008

    Neil Williams: Finance software in Emdebian

    Grisbi is now
    available in Emdebian but without libofx. Similarly homebank is in Emdebian (note that homebank-data is also needed and is available), again without libofx.

    I'm not convinced that libofx is that much of a loss on an embedded device - especially when libofx and dependencies could add 5Mb to an existing installation - just for the shared libraries!

    The screenshots of Grisbi in Maemo gave my the idea of adding grisbi and I've been trying it out on the desktop too. Once I'd tweaked the column widths for the transaction window (hidden away in Preferences), it is quite usable - although I can't see any way of it handling invoices.

    My own gpe-cash is not making much progress - the GnuCash objects are just too resistant to use outside GnuCash. :-( It may be easier to create invoices from grisbi/homebank data via CSV and estron.

    This is aimed at the more powerful end of Emdebian devices but each package is still 50% smaller in Emdebian than in Debian, closer to 80% smaller if you count the reduced dependencies. The main difference is the use of TDebs.

    Christian Perrier and I are planning on working on TDebs during DebConf8 and Extremadura so that bugs and fixes to support TDebs can be implemented in Debian as soon as Lenny is released. Removing translations from the maintainer uploads and translation bugs from the package BTS should make it a lot easier to update translations without requiring an NMU of the entire package (which is complete overkill IMNSHO).

    Together with DEB_BUILD_OPTIONS="nodocs" support, TDebs are the simplest way to reduce package sizes and installation sizes in Debian/Emdebian.

    (I just wish #448615 could be fixed so that I could get on with preparing patches for packages that install docs without using debhelper.)

    9 April 2008

    Adrian von Bidder: Mercurial

    After my moderately successful attempts at learning git, I have now tackled Mercurial and found it easy to understand and use. I can't quite see where git is better, so I guess I'll stick with hg now. Output so far is a script I call hgdebuild, which I'll probably package when it's a bit less rough around the edges (yes, I know about hg-buildpackage, but I didn't really like it, and it appears to be orphaned at the moment anyway). Also, with Mercurial, I very easily could address the main problem I've always had with distributed revision control systems: With Subversion, it's easy to work on different computers, and backing up my home directory has become less critical (an important aspect on my Laptop). Both of these are not true when suddenly .hg in my working dir is the backing store.
    $ cat ~/.hgrc
    [hooks]
    commit.push = [ -f .hg/dopush ] \
        && ping -w 1 -c 2 -q -i .2 mygitserver.example.com >/dev/null 2>/dev/null \
        && hg push \
          true
    
    (Probably this problem has been solved before. Comments welcome.) Comments: From the person with madduck in his email address: Bzr checkouts, or a similar Git hook.

    16 March 2008

    Romain Francoise: Updated Debian Vcs-* statistics

    Today I discovered that I have a nightly cron job on one of my machines to generate the Vcs statistics I mentioned previously; somehow I had forgotten. So here's an updated graph:

    Subversion and Git are still growing fast, the others aren't very successful. 18.8% of all source packages in main are maintained in Subversion, and Git is up to 4.3%.

    It's also interesting to note that 91% of the packages maintained in Subversion are hosted on Alioth (svn.debian.org) whereas 77% of the packages maintained in Git are on git.debian.org.

    4 March 2008

    Axel Beckert: Is ikiwiki a Website Meta Language killer?

    On this year’s Chemitzer Linux-Tage (CLT, engl. “Chemnitz Linux Days’) I attended a few talks of which especially formorer’s ikiwiki talk was very interesting. I attended his talk since I found out that ikiwiki is command line wiki compiler in contrary to the thousands of solely web based wikis out there. As a big fan of statically generated content this idea sounded very interesting to me. But just having a short look at ikiwiki’s web page didn’t help to get started and it seemed as if I had not the right idea of how ikiwiki works to get started. So formorer’s talk seemed to be a good possibility to get an idea of how ikiwiki works without much effort. During the talk I noticed that ikiwiki can many things I do with the Website Meta Language (WML), but can do some more things WML can’t do out of the box:
    1. It’s not only a framework to generate web pages, it’s more like a content management system (CMS).
    2. Versioning is intergal part of ikiwiki without reinventing the wheel: It works out of the box with — beyond others — Subversion, Git and Mercurical (Hg).
    And when formorer showed that even Tobi Oetiker uses ikiwiki, I noticed that ikiwiki probably could be a WML killer, since I knew Tobi as a WML fan. And ikiwiki looks very appealing for the WML fan inside me, too… OTOH: Intergrating WML as a backend to ikiwiki could be an interesting idea, though. Hearing what kind of input files ikiwiki can process, I also got the idea of using hnb (Hierachical Notebook) files as input for ikiwiki. hnb files are already XML and so a conversion to XHTML shouldn’t be that hard. But when searching the web for “ikiwiki hnb” I found the blog postings of a few people switching away from hnb, e.g. to vimoutliner. Since I’m an Emacs addict and don’t like vim very much (if I use a vi, I use nvi or elvis), I searched for “emacs hnb” and indeed found someone who switched from hnb to org-mode – of which I never heard before. Unfortunately org-mode doesn’t seem to be in Debian (Update 00:23: Yeah, yeah, I now know it’s included in emacs22, but emacs22 hasn’t made it into kfreebsd-i386 yet, so I didn’t notice. See the comments. :-) but I’ll play around with it a little bit. Unfortunately a first test wasn’t that promising. But we’ll see.

    Now playing: Men at Work — Down Under

    11 January 2008

    Felipe Augusto van de Wiel: 11 Jan 2008

    Bits from the Debian i18n meeting (Extremadura 2007)
    From December 12th to December 15th, Junta de Extremadura hosted another one of the Debian Meetings; five i18n guys shared ideas, food, buses and fun with the Debian KDE maintainers. We would like to thank Extremadura for hosting us during the Hispalinux Meeting 2007, the event was held at Universad de Derecho (Law University) in Caceres, Spain.

    These are the minutes, results and notes from our work, it is a brief description but hopefully complete of what we have done and what is still missing/pending.

    Thanks to Cesar (cek) we had the chance to work on churro (i18n.debian.net) locally; the server is still running a 2.4 kernel because of some "tick" problems with 2.6 series, the last one tried was 2.6.21 and we should try newer ones, in order to support upgrades and not get stuck with 2.4, we hope Cesar will find time to test new Debian kernels.

    First, let me introduce everybody to the services, robots and resources being hosted by i18n.d.n:

    • MoinMoin wiki for local and simple reference documentation, it contains all the links to the below resources. (http://i18n.debian.net/wiki/)
    • Pootle experimental server
    • dl10n scripts, aka dl10n robots (codename Lion), these scripts are responsible for the status of pseudo URLs used by some translation teams, by the Project Smith and by the NMU Priority List for i18n NMU Campaign
    • Synchronization of the i18n material used by the Debian website to generate translation statistics about PO and PO-debconf
    • Generation of Compendium PO files per-language
    • Different types of statistics
    • Other non user-visible services like a full source mirror for stable, testing, unstable and experimental, used by the scripts and robots.
    • DDTP, Debian Descriptions Translation Project
    • DDTSS, The Debian Distributed Translation Server Satellite, a web front-end for DDTP, now integrated to DDTP to use the Database back-end instead of the e-mail interface.


    And, at some point, we found important to state clear the acronyms and names used in related DDTP projects/tools:
    • DDTS, Debian Description Translation Server, this is the main "back-end" used in DDTP, it tends to be the interface between translator tools (present and future ones) and the database;
    • ddt.cgi is a CGI interface that is able to provide info for specific packages or translations, including diffs, related packages and active/inactive descriptions.
    • DDTC which is the old (and still functional) command line client for DDTP.


    We took the chance to organize a few things on churro, old accounts were cleaned out and removed, we moved from /org to /srv and got more GBs of space to the "playground". Old files were also removed and some are schedule to deletion on early 2008. With the reallocation of /org we also find some more space to /home and /var, we reorganize some of the links on the web space (specially to remove services from people's accounts), and we changed the mirror script to also synchronize the Packages and Contents files.

    Grisu and Martijn worked mainly on DDTP and DDTSS integration. DDTSS now provides statistics for stable, testing and unstable, we are also working with Debian Med to provide support and infrastructure to a specific audience, like packages related to Medicine. The conversion to talk directly with DDTP/DDTS database also provided:

    • Fetching new translations is almost instantaneous and marks translation as requested (avoiding duplicated works via the e-mail interface).
    • After sufficient reviews occurred, the upload is instant
    • Committed DDTS / DDTSS / DDTP website generation into SVN
      • Added READMEs for the above directories


    DDTSS now announces the user using authentication because of its integration with the Database backend used by DDTP. Quick trivia: DDTP is now a compound of 25 languages occupying 18 GBytes.

    A few days before the meeting we had the offer to use "AUTOBYHAND" to upload a package with the Translation-* files. The package is now called 'ddtp-translations' and we worked during the meeting to create scripts to build the package and to test it on the archive side. This approach allow Debian i18n Team to upload new translations and remove old ones (or inactive ones) without bother FTP Master Team. Special thanks to Anthony Town, he has been working with us to prove tips, fixes and info on how to produce the package and the scripts. The code is available in the debian-l10n SVN under pkg-ddtp-translations:
    http://svn.debian.org/viewsvn/debian-l10n/pkg-ddtp-translations

    In our case, "BYHAND" processing consists of a simple tarball of the main,contrib,non-free /i18n/Translation-*, we decide to work on a set of scripts to make it easier to create new packages (ddtp-translations) in a consistent way and keeping debian/changelog up-to-date. We also made some suggestions to the script what will run on the archive side to check the tarball structure, base on the examples of debian-maintainers and debtags (tags-override).

    One of our initial targets for the meeting with regards to Pootle and Debian was to try big PO files per language, fortunately, Nicolas and Friedel were able to increase Pootle performance enough to get a few languages from DDTP loaded in Pootle. Using the upstream Pootle-diet branch, which uses a database back-end for the generation of statistics, the time to browse the DDTP POs of a language (~20.000 files) went down to a dozen of seconds.

    Speaking about Pootle, Friedel gave us a good picture of what is coming next in terms of Pootle's development. There are improvements planned in the areas of permissions and rights delegation, as well as file management (for projects and templates). Improved management of terminology projects is also planned.

    Improvements in the QA capabilities of the translate toolkit and Pootle are planned to help with the "false positives" of the pofilter checks. Better reuse of existing translations will become possible by using better translation memory techniques. There is also work planned on formats and converters involving, for example, XLIFF, TMX, TRADOS and WordFast.

    Another pending task for quite a while was the CVS migration to SVN, it is now done, with a new layout. Commits to the CVS were disabled and every single script or resource depending on CVS should be changed to use SVN. For now, we are publishing (via HTTP) the status files generated by the pseudo-urls robots until we can fix the scripts to re-enable the commit of the files. You can find them here: http://i18n.debian.net/debian-l10n/status/

    We are pretty happy with the changes and results of the work during those days, but we still have some items pending on our TODO list:

    • More advertisement and usage information about PO Compendiums
      There are two use cases are identified:
      • Filling new PO files.
      • QA work to find inconsistent translations.
      Maybe Eddy would love to do that? :-)
    • Extend the duration of the statistics history. (Nekral)
    • Debian packages of the services running on churro
      • DDTP (Grisu)
      • DDTSS (Martijn)
      • dl10n (Nekral)
    • DDTP: add some scripts to handle packages with version in the description (e.g. kernel and kernel modules) (Martijn)
    • DDTP: Standard generation of the translation tarballs (faw)
    • DDTP: document the bracketed stats on the main page (faw)
    • DDTC: should be updated to match the current features. Documentation to ease integration with procmail. (Nekral - low priority)
    • Implement mail service for translation teams with their own robots (e.g. Dutch) (faw)
    • Collect data from http://www.debian.org/devel/website/stats/ (Nekral)
    • http://www.debian.org/intl/l10n/po/,
      http://www.debian.org/intl/l10n/po-debconf/
      are built based on the churro material. It would make more sense to build these statistics on churro (Nekral)
      • We could "fork" the page and add some fancy new features on these pages (Nekral)
      • Add information from the coordination page to indicate that a translation is ongoing. (Nekral)
    • Pootle: missing review indication. Hard with PO back-end. (Friedel)


    There are a couple more reports to be sent but they are more focused on i18n specific questions, tools and plans for 2008. So, probably those will be sent only to debian-i18n mail list. If you are interested, please, stay tuned. :-)
    Posted on d-d-a: http://lists.debian.org/debian-devel-announce/2008/01/msg00002.html
    And a big thanks to Nicolas François (aka nekral), he helped me a lot making notes, preparing the text and reviewing it; and was patient enough to wait for the report while I was solving some personal problems.

    6 November 2007

    Manoj Srivastava: Manoj: Continuous Automated Build and Integration Environment

    One of the things I have been tasked to do in my current assignment is to create a dashboard of the status of various software components created by different contractors (participating companies) in the program. These software components are built by different development groups, utilizing unlike toolsets, languages and tools though I was able to get an agreement on the VCS (subversion yuck). Specifically, one should be able to tell which components pass pre-build checks, compile, can be installed, and pass unit and functional tests. There should be nightly builds, as well as builds whenever someone checks in code on the release branches. And, of course, the dashboard should be HTTP accessible, and be bright and, of course, shiny. My requirements were that since the whole project is not Java, there should be no dependencies on maven or ant or eclipse projects (or make, for that matter); that it should be able to do builds on multiple machines (license constraints restrict some software to Solaris or Windows), not suck up too much time from my real job (this is a service, if it is working well, you get no credit, if it fails, you are on the hot seat). And it should be something I can easily debug, so no esoteric languages (APL, haskell and Python :P) So, using continuous integration as a google search term, I found the comparison matrix at Damage Control I looked at anthill, and cruisecontrol, and the major drawback people seemed to think it had was that configuration was done by editing an XML file, as opposed to a (by some accounts, buggy) UI is not much of a factor for me. (See this). I also like the fact that it seems easier to plug in other components. I am uncomfortable with free software that has a commercial sibling; we have been burned once by UML software with those characteristics. Cruisecontrol, Damagecontrol, Tinderbox1 & tinderbox2, Continuum, and Sin match. I tried to see the demo versions; Sin s link led me to a site selling Myrtle Beach condo s, never a good sign. Continuum and Damagecontrol were currently down, so I could not do an evaluation. So, here are the ones I could get to with working demo pages: http://cclive.thoughtworks.com/ and http://tinderbox.mozilla.org/showbuilds.cgi?tree=SeaMonkey Cruisecontrol takes full control, checking things out of source control; and running the tests; which implies that all the software does build and run on the same machine this is not the case for me. Also, CC needs to publish the results/logs in XML; which seems to be a good fit for the java world; but might be a constraint for my use case. I like the tinderbox dashboard better, based on the information presented; but that is not a major issue. It also might be better suited for a distributed, open source development model; cruisecontrol seems slightly more centralized more on this below. cruisecontrol is certainly more mature; and we have some experience with it. Tinderbox has a client/server model, and communicates via EMAIL to a number of machines where the actual build/testing is done. This seems good. Then there is flamebox nice dashboard, derivative of tinderbox2; and seems pretty simple (perhaps too simple); and easily modifiable. However, none of these seemed right. There was too much of an assumption of a build and test model and few of them seemed to be a good fit for a distributed, Grid-based software development; so I continued looking. Cabie screen shot. I finally decided CABIE
    Continuous Automated Build and Integration Environment. Cabie is a multi-platform, multi-cm client/server based application providing both command line and web-based access to real time build monitoring and execution information. Cabie builds jobs based upon configuration information stored in MySQL and will support virtually any build that can be called from the command line. Cabie provides a centralized collection point for all builds providing web based dynamic access, the collector is SQL based and provides information for all projects under Cabie s control. Cabie can be integrated with bug tracking systems and test systems with some effort depending on the complexity of those systems. With the idea in mind that most companies create build systems from the ground up, Cabie was designed to not have to re-write scripted builds but instead to integrate existing build scripts into a smart collector. Cabie provides rapid email notification and RSS integration to quickly handle build issues. Cabie provides the ability to run builds in parallel, series, to poll jobs or to allow the use of scripted nightly builds. Cabie is perfect for agile development in an environment that requires multiple languages and tools. Cabie supports Perforce, Subversion and CVS. The use of a backend broker allows anyone with perl skills to write support for additional CM systems.
    The nice people at Yo Linux have provided a Tutorial for the process. I did have to make some changes to get things working (mostly in line with the changes recommended in the tutorial, but not exactly the same. I have sent the patches upstream, but upstream is not sure how much of it they can use, since there has been major progress since the last release. The upstream is nice and responsive, and have added support in unreleased versions for using virtual machines to run the builds in (they use that to do the solaris/windows builds), improved the web interface using (shudder) PHP, and and all kinds of neat stuff.

    14 October 2007

    Martin F. Krafft: Converting a package to Git

    Previously, I demonstrated a Debian packaging workflow using Git and I mentioned the possibility of a follow-up post; well, here it is: you want to use my workflow (or one that's related) for a package that is currently maintained with Subversion on svn.debian.org and you'd like to keep the history during the conversion. Make sure to read the previous post before this one. I am again using the example of mdadm since its Git packaging repository is in a state of shambles and I want to restart to get it right and import the history from the previous Subversion repository. What better way than to write a blog post as I do so? Well, plenty actually. This kind of post isn't really made for a blog, and I have started work on setting up ikiwiki on madduck.net, but it's not yet ready, so I'll stick with the blog for now. I will make sure that links don't break as I move content over, so feel free to bookmark this
    Importing the package into Git Thanks to git-svn, the initial step of getting your package imported into Git is a breeze:
    $ git-svn clone --stdlayout --no-metadata \
        svn+ssh://svn.debian.org/svn/pkg-mdadm/mdadm mdadm
    
    Sit back and enjoy. If that command exits prematurely with an error such as the following:
    Malformed network data: Malformed network data at /usr/local/bin/git-svn line 1029
    then you should upgrade to a newer Git version, or have a look here. If your Git does not know --stdlayout then upgrade as well (or use -T trunk -t tags -b branches instead). Sam Vilain notes that it is important to "get the attribution right with the final SVN import - getting the authors map right. I didn't do that. If you look at the repository resulting from the above command, you'll notice strange commit authors, such as madduck@some-unique-uuid-from-svn . git-svn allows you to map these to real names with real email addresses, which ensures that the attributions are good for the whole world to see. When done, switch to the repository and run git-branch -r. As you'll see, git-svn imported all SVN branches and tags as remote branches. You need those if you want to bidirectionally track the Subversion repository, but we are converting, as you may have guessed by the --no-metadata switch above. Therefore, we resort to the Dinosaur method of converting branches to tags, which I'll simplify for mdadm. We also just delete all remote branches after tagging, since mdadm never used branches in the SVN repository. Your mileage may vary.
    git branch -r   sed -rne 's, *tags/([^@]+)$,\1,p'   while read tag; do
      echo "git tag debian/$tag tags/$ tag ^; git branch -r -d tags/$tag"
    done
    git branch -r   while read tag; do
      echo "git branch -r -d $tag"
    done
    
    If that seems to work alright, then you can execute the commands. Sam Vilain (again) hints me at git-pack-refs and then to edit .git/packed-refs with an editor. This certainly leaves more room for errors but might be significantly faster.
    Cleaning up the SVN references Even though we passed --no-metadata to git-svn, it did leave some traces in .git/, which we can now safely remove:
    $ git config --remove-section svn-remote.svn
    $ rm -r .git/svn
    
    Setting things straight You can skip this section unless you want to know a bit about how to fix up stuff with Git. There was actually some nasty tagging errors leading up to the 2.5.6-9 release for etch and I could never be bothered to fix those in SVN, but now I can (I love Git!):
    $ git tag -d debian/2.5.6-10            # never existed
    $ git tag -f debian/2.5.6-8 2.5.6-8~2   # mistagged
    $ git checkout -b maint/etch 2.5.6-8    # this is when we diverged
    $ git apply < /tmp/mdadm-2.5.6-8..2.5.6-9.diff
    $ git add debian/po/gl.po debian/po/pt.po debian/changelog
    $ git commit -s
    $ git tag debian/2.5.6-9
    
    Now that that's fixed, there is one other thing to worry about, namely the very last commit to SVN, which obsoletes the repository and points to the Git repository. But that's not all of it. I was also silly enough to include a fix in the same commit. Let's see what Git can do. Since the process of obsoletion involves all but adding a file, we can simply --amend the last commit and provide a new log message:
    $ git checkout master
    $ git rm OBSOLETE debian/OBSOLETE
    $ git commit --amend
    
    Now the repository is in an acceptable state.
    Making ends meet The pkg-mdadm effort on svn.debian.org only maintained the ./debian/ directory, separate from the upstream code, and boy was that a bad idea. Just to give one example: think about what's involved in preparing a Debian-specific patch against the upstream code this has to end, and we can make it end right here; let's import upstream's code (again not using his ADSL line, but the upstream branch of the pkg-mdadm Git repository; see the previous post for details):
    $ git remote add upstream-repo git://git.debian.org/git/pkg-mdadm/mdadm
    $ git config remote.upstream-repo.fetch \
        +refs/heads/upstream:refs/remotes/upstream-repo/upstream
    $ git fetch upstream-repo
    $ git checkout -b upstream upstream-repo/master
    
    Now we have two unconnected ancestries in our repository, and it's time to join them together. The most logical way seems to be to use the last upstream tag for which we have a Debian tag: 2.6.2. For this, we branch off the corresponding Debian tag (2.6.2-1) and merge upstream's 2.6.2 tag into the new branch. This will be a temporary branch Then, we rebase (remember, nothing has been published yet) the master branch on top of this temporary branch, before we end that branch's short life. The Debian tag stays where it is since it describes the state of the repository at time of the release of 2.6.2-1.
    $ git checkout -b tmp/join debian/2.6.2-1
    $ git merge mdadm-2.6.2
    $ git rebase tmp/join master
    $ git branch -d tmp/join
    
    It just so happens that the head of the SVN repository, which is identical to the tip of our master branch, corresponds to Debian release 2.6.2-2, so we tag it:
    $ git tag debian/2.6.2-2
    
    We are now also "born" in the sense that maintenance in Git has started. Let's mark that point in history. There is no real reason I can foresee for this yet, but nonetheless:
    $ git tag -s git-birth
    
    Turning dpatch files into feature branches We want to turn dpatch files into feature branches and we somehow make it "proper". We could branch, apply the patch, delete the patch file, checkout master and delete the patch file there as well, but that appears "improper" to me at least; so instead, we'll cherry-pick:
    $ git checkout -b deb/conffile-location
    $ debian/patches/01-mdadm.conf-location.dpatch -apply
    $ git rm debian/patches/01-mdadm.conf-location.dpatch
    $ git commit -s
    $ git commit -s $(git ls-files --others --modified)
    
    I should quickly intervene to make sure you are following. I am making use of Git's index here. Applying the patch makes the changes in the working tree, but we did not tell Git that we want those to be part of the commit just yet. Instead, we delete the dpatch with git-rm, which automatically registers the deletion with the index. Thus, the first git-commit creates a commit which deletes the dpatch, while the second git-commit creates a commit with all the changes from the dpatch, using git-ls-files to identify new and modified files. But for now, let's move on. We have two commits in the deb/conffile-location branch, and one of those is relevant to the master branch, we cherry-pick it:
    $ git cherry-pick deb/conffile-location^
    
    If you're confused, let me explain: our goal is to have a number of feature branches, of which master is the one in which most of ./debian/ is maintained. All the branches later come together in the long-living build branch, so deb/conffile-location will never be merged back into master. However, once we applied the dpatch to the feature branch, we can delete it from there and the master branch. By cherry-picking, we "import" the deletion to the master branch. I repeat the same procedure for deb/docs, merging all the documentation-related dpatches, but I'll spare you the details.
    and then Git let me down In the next step, I found I had misunderstood Git merging: I thought Git was smart, but Linus had his reasons for calling Git the "stupid content tracker" (more on that later). Read on as I am obsoleting dpatch files that upstream had merged: 99-*-FIX.dpatch. For consistency, I wanted to cherry-pick each of the appropriate upstream commits into the master branch along with deleting the corresponding dpatch file. Here is one example: 99-monitor-6+10-FIX.dpatch was obsoleted by upstream's commit 66f8bbb; the -x records the original commit ID in the log:
    $ git cherry-pick -x 66f8bbb
    $ git rm debian/patches/99-monitor-6+10-FIX.dpatch
    $ git commit -s -m"remove dpatch obsoleted by $(git rev-parse --short HEAD)"
    
    I repeated the procedure for the other dpatch files, removed the dpatch infrastructure, and then went on to merge it all into build to build the package. The build branch is a long-living branch off upstream, but which upstream? I'll fast-forward you past a segfault problem with mdadm, which upstream (thought to have) resolved with commit 23dc1ae after 2.6.3, but he had not yet released 2.6.4. Looking at the commits between 23dc1ae and upstream's HEAD at the time, I decided to include them all and snapshot 4450e59:
    $ git fetch upstream-repo
    $ git checkout upstream
    $ git merge upstream-repo
    $ git tag mdadm-2.6.3+200709292116+4450e59 4450e59
    $ git checkout master
    $ git merge --no-commit mdadm-2.6.3+200709292116+4450e59
    $ dch -v mdadm-2.6.3+200709292116+4450e59-1
    $ git add debian/changelog
    $ git commit -s
    
    And then I called poor-mans-gitbuild, which merges master and then deb/* into build. Here is when stuff blew up. I'll make a long story short (read my description of the problem and Linus' answer if you want to know more): I thought Git was smart to identify merges common to both branches and do the right thing, but it turn out that Git does not care at all about commits, it only worries about content and the end result. In our case, unfortunately (or fortunately), the outcome meant a conflict because the upstream branch introduced a simple change (last hunk) in the lines surrounding the patch we cherry-picked, and Git can't handle it. The solution is not to cherry-pick, to cherry-pick all commits touching the context of the dpatch, or to simply merge upstream into all out feature branches. In our case, the first is the easiest solution and since importing dpatch files is a one-time thing (thank $DEITY), I'll leave it at that. Almost. I have spent two days thinking about this more than I should have. And it was this point Linus made which made me appreciate Git even more:
    Conflicts aren't bad - they're good. Trying to aggressively resolve them automatically when two branches have done slightly different things in the same area is stupid and just results in more problems. Instead, git tries to do what I don't think anybody else has done: make the conflicts easy to resolve, by allowing you to work with them in your normal working tree, and still giving you a lot of tools to help you see what's going on.
    The end This concludes today's report. Importing the changes from the old Git repo, tagging and merging the branches is all covered in my previous post, or at least you'll find enough information there to complete the exercise. I would like to specifically thank Sam Vilain and Linus Torvalds for their help in preparing this post, as well as the #git/freenode inhabitants, as always. If you are interested in the topic of using version control for distro packaging, I invite you to join the vcs-pkg mailing list and/or the #vcs-pkg/irc.oftc.net IRC channel. Also, if you are interested in Git in general, you can find a list of blog posts on the Git wiki. NP: The Police: Zenyatta Mondatta

    10 October 2007

    Martin F. Krafft: Packaging with Git

    Introduction I gave a joint presentation with Manoj at Debconf7 about using distributed version control for Debian packaging, and I volunteered to do an on-line workshop about using Git for the task, so it's about time that I should know how to use Git for Debian packaging, but it turns out that I don't. Or well, didn't. After I made a pretty good mess out of the mdadm packaging repository (which is not a big problem as it's just ugly history up to the point when I start to get it right), I decided to get down with the topic and figure it out once and for all. I am writing this post as I put the pieces together. It's been cooking for a week, simply so I could gather enough feedback. I am aware that Git is not exactly a showcase of usability, so I took some extra care to not add to the confusion. It may be the first post in a series, because this time, I am just covering the case of mdadm, for which upstream also uses Git and where I am the only maintainer, and I shall pretend that I am importing mdadm to version control for the first time, so there won't be any history juggling. Future posts could well include tracking Subversion repositories with git-svn, and importing packages previously tracked therewith, but this ain't no promise! (well, that last post is already being drafted, but far from finished; you have been warned!) I realise that git-buildpackage exists, but imposes a rather strict branch layout and tagging scheme, which I don't want to adhere to. And gitpkg (Romain blogged about it recently), deserves another look since, according to its author, it does not impose anything on its user. But in any case, before using such tools (and possibly extending them to allow for other layouts), I'd really rather have done it by hand a couple of times to get the hang of it and find out where the culprits lie. Now, enough of the talking, just one last thing: I expect this blog post to change quite a bit as I get feedback. Changes shall be highlighted in bold typeface.
    Setting up the infrastructure First, we prepare a shared repository on git.debian.org for later use (using collab-maint for illustration purposes), download the Debian source package we want to import (version 2.6.3+200709292116+4450e59-3 at time of writing, but I pretend it's -2 because we shall create -3 further down ), set up a local repository, and link it to the remote repository. Note that there are other ways to set up the infrastructure, but this happens to be the one I prefer, even though it's slightly more complicated:
    $ ssh alioth
    $ cd /git/collab-maint
    $ ./setup-repository pkg-mdadm mdadm Debian packaging
    $ exit
    $ apt-get source --download-only mdadm
    $ mkdir mdadm && cd mdadm
    $ git init
    $ git remote add origin ssh://git.debian.org/git/collab-maint/pkg-mdadm
    $ git config branch.master.merge refs/heads/master
    
    Now we can use git-pull and git-push, except the remote repository is empty and we can't pull from there yet. We'll save that for later. Instead, we tell the repository about upstream's Git repository. I am giving you the git.debian.org URL though, simply because I don't want upstream repository (which lives on an ADSL line) hammered in response to this blog post:
    $ git remote add upstream-repo git://git.debian.org/git/pkg-mdadm/mdadm
    
    Since we're using the upstream branch of the pkg-mdadm repository as source (and don't want all the other mess I created in that repository), we'll first limit the set of branches to be fetched (I could have used the -t option in the above git-remote command, but I prefer to make it explicit that we're doing things slightly differently to protect upstream's ADSL line).
    $ git config remote.upstream-repo.fetch \
        +refs/heads/upstream:refs/remotes/upstream-repo/upstream
    
    And now we can pull down upstream's history and create a local branch off it. The "no common commits" warning can be safely ignored since we don't have any commits at all at that point (so there can't be any in common between the local and remote repository), but we know what we're doing, even to the point that we can forcefully give birth to a branch, which is because we do not have a HEAD commit yet (our repository is still empty):
    $ git fetch upstream-repo
    warning: no common commits
    [ ]
      # in the real world, we'd be branching off upstream-repo/master
    $ git checkout -b upstream upstream-repo/upstream
    warning: You appear to be on a branch yet to be born.
    warning: Forcing checkout of upstream-repo/upstream.
    Branch upstream set up to track remote branch
      refs/remotes/upstream-repo/upstream.
    $ git branch
    * upstream
    $ ls   wc -l
    77
    
    Importing the Debian package Now it's time to import Debian's diff.gz remember how I pretend to use version control for package maintenance for the first time. Oh, and sorry about the messy file names, but I decided it's best to stick with real data in case you are playing along: Since we're applying the diff against version 2.6.3+200709292116+4450e59, we ought to make sure to have the repository at the same state. Upstream never "released" that version, but I encoded the commit ID of the tip when I snapshotted it: 4450e59, so we branch off there. Since we are actually tracking the git.debian.org pkg-mdadm repository instead of upstream, you can use the tag I made. Otherwise you could consider tagging yourself:
    $ #git tag -s mdadm-2.6.3+200709292116+4450e59 4450e59
    $ git checkout -b master mdadm-2.6.3+200709292116+4450e59
    $ zcat ../mdadm_2.6.3+200709292116+4450e59-2.diff.gz   git apply
    
    The local tree is now "debianised", but Git does not know about the new and changed files, which you can verify with git-status. We will split the changes made by Debian's diff.gz across several branches.
    The idea of feature branches We could just create a debian branch, commit all changes made by the diff.gz there, and be done with it. However, we might want to keep certain aspects of Debianisation separate, and the way to do that is with feature branches (also known as "topic" branches). For the sake of this demonstration, let's create the following four branches in addition to the master branch, which holds the standard Debian files, such as debian/changelog, debian/control, and debian/rules:
    • upstream-patches will includes patches against the upstream code, which I submit for upstream inclusion.
    • deb/conffile-location makes /etc/mdadm/mdadm.conf the default over /etc/mdadm.conf and is Debian-specific (thus the deb/ prefix).
    • deb/initramfs includes the initramfs hook and script, which I want to treat separately but not submit upstream.
    • deb/docs similarly includes Debian-only documentation I add to the package as a service to Debian users.
    If you're importing a Debian package using dpatch, you might want to convert every dpatch into a single branch, or at least collect logical units into separate branches. Up to you. For now, our simple example suffices. Keep in mind that it's easy to merge two branch and less trivial to split one into two. Why? Well, good question. As you will see further down, the separation between master and deb/initramfs actually makes things more complicated when you are working on an issue spanning across both. However, feature branches also bring a whole lot of flexibility. For instance, with the above separation, I could easily create mdadm packages without initramfs integration (see #434934), a disk-space-conscious distribution like grml might prefer to leave out the extra documentation, and maybe another derivative doesn't like the fact that the configuration file is in a different place from upstream. With feature branches, all these issues could be easily addressed by leaving out unwanted branches from the merge into the integration/build branch (see further down). Whether you use feature branches, and how many, or whether you'd like to only separate upstream and Debian stuff is entirely up to you. For the purpose of demonstration, I'll go the more complicated way.
    Setting up feature branches So let's commit the individual files to the branches. The output of the git-checkout command shows modified files that have not been committed yet (which I trim after the first example); Git keeps these across checkouts/branch changes. Note that the ./debian/ directory does not show up as Git does not know about it yet (git-status will tell you that it's untracked, or rather: contains untracked files since Git does not track directories at all):
    $ git checkout -b upstream-patches mdadm-2.6.3+200709292116+4450e59
    M Makefile
    M ReadMe.c
    M mdadm.8
    M mdadm.conf.5
    M mdassemble.8
    M super1.c
    $ git add super1.c     #444682
    $ git commit -s
      # i now branch off master, but that's the same as 4450e59 actually
      # i just do it so i can make this point 
    $ git checkout -b deb/conffile-location master
    $ git add Makefile ReadMe.c mdadm.8 mdadm.conf.5 mdassemble.8
    $ git commit -s
    $ git checkout -b deb/initramfs master
    $ git add debian/initramfs/*
    $ git commit -s
    $ git checkout -b deb/docs master
    $ git add RAID5_versus_RAID10.txt md.txt rootraiddoc.97.html
    $ git commit -s
      # and finally, the ./debian/ directory:
    $ git checkout master
    $ chmod +x debian/rules
    $ git add debian
    $ git commit -s
    $ git branch
      deb/conffile-location
      deb/docs
    * master
      upstream
      upstream-patches
    
    At this time, we push our work so it won't get lost if, at this moment, aliens land on the house, or any other completely plausible event of apocalypse descends upon you. We'll push our work to git.debian.org (the origin, which is the default destination and thus needs not be specified) by using git-push --all, which conveniently pushes all local branches, thus including the upstream code; you may not want to push the upstream code, but I prefer it since it makes it easier to work with the repository, and since most of the objects are needed for the other branches anyway after all, we branched off the upstream branch. Specifying --tags instead of --all pushes tags instead of heads (branches); you couldn't have guessed that! See this thread if you (rightfully) think that one should be able to do this in a single command (which is not git push refs/heads/* refs/tags/*)
    $ git push --all
    $ git push --tags
    
    Done. Well, almost
    Building the package (theory) Let's build the package. There seem to be two (sensible) ways we could do this, considering that we have to integrate (merge) the branches we just created, before we fire off the building scripts:
    1. by using a temporary (or "throw-away") branch off upstream, where we integrate all the branches we have just created, build the package, tag our master branch (it contains debian/changelog), and remove the temporary branch. When a new package needs to be built, we repeat the process.
    2. by using a long-living integration branch off upstream, into which we merge all our branches, tag the branch, and build the package off the tag. When a new package comes around, we re-merge our branches, tag, and build.
    Both approaches have a certain appeal to me, but I settled for the second, for two reasons, the first of which leads to the second:
    1. When I upload a package to the Debian archive, I want to create a tag which captures the exact state of the tree from which the package was built, for posterity (I will return to this point later). Since the throw-away branches are not designed to persist and are not uploaded to the archive, tagging the merging commit makes no sense. Thus, the only way to properly identify a source tree across all involved branches would be to run git-tag $branch/$tagname $branch for each branch, which is purely semantic and will get messy sooner or later.
    2. As a result of the above: when Debian makes a new stable release, I would like to create a branch corresponding to the package in the stable archive at the time, for security and other proposed updates. I could rename my throw-away branch, if it still existed, or I could create a new branch and merge all other branches, using the (semantic) tags, but that seems rather unfavourable.
    So instead, I use a long-living integration branch, notoriously tag the merge commits which produced the tree from which I built the package I uploaded, and when a certain version ends up in a stable Debian release, I create a maintenance branch off the one, single tag which corresponds to the very version of the package distributed as part of the Debian release. So much for the theory. Let's build, already!
    Building the package (practise) So we need a long-living integration branch, and that's easier done than said:
    $ git checkout -b build mdadm-2.6.3+200709292116+4450e59
    
    Now we're ready to build, and the following procedure should really be automated. I thus write it like a script, called poor-mans-gitbuild, which takes as optional argument the name of the (upstream) tag to use, defaulting to upstream (the tip):
    #!/bin/sh
    set -eu
    git checkout master
    debver=$(dpkg-parsechangelog   sed -ne 's,Version: ,,p')
    git checkout build
    git merge $ 1:-upstream 
    git merge upstream-patches
    git merge master
    for b in $(git for-each-ref --format='%(refname)' refs/heads/deb/*); do
      git merge -- $b
    done
    git tag -s debian/$debver
    debuild   # will ignore .git automatically
    git checkout master
    
    Note how we are merging each branch in turn, instead of using the octopus merge strategy (which would create a commit with more than two parents) for reasons outlined in this post. An octopus-merge would actually work in our situation, but it will not always work, so better safe than sorry (although you could still achieve the same result). If you discover during the build that you forgot something, or the build script failed to run, just remove the tag, undo the merges, checkout the branch to which you need to commit to fix the issue, and then repeat the above build process:
    $ git tag -d debian/$debver
    $ git checkout build
    $ git reset --hard upstream
    $ git checkout master
    $ editor debian/rules    # or whatever
    $ git add debian/rules
    $ git commit -s
    $ poor-mans-gitbuild
    
    Before you upload, it's a good idea to invoke gitk --all and verify that all goes according to plan:
    screenshot of gitk after the above steps
    When you're done and the package has been uploaded, push your work to git.debian.org, as before. Instead of using --all and --tags, I now specify exactly which refs to push. This is probably a good habit to get into to prevent publishing unwanted refs:
    $ git push origin build tag debian/2.6.3+200709292116+4450e59-3
    
    Now take your dog for a walk, or play outside, or do something else not involving a computer or entertainment device.
    Uploading a new Debian version If you are as lucky as I am, the package you uploaded still has a bug in the upstream code and someone else fixes it before upstream releases a new version, then you might be in the position to release a new Debian version. Or maybe you just need to make some Debian-specific changes against the same upstream version. I'll let the commands speak for themselves:
    $ git checkout upstream-patches
    $ git-apply < patch-from-lunar.diff   #444682 again
    $ git commit --author 'J r my Bobbio <lunar@debian.org>' -s
      # this should also be automated, see below
    $ git checkout master
    $ dch -i
    $ dpkg-parsechangelog   sed -ne 's,Version: ,,p'
    2.6.3+200709292116+4450e59-3
    $ git commit -s debian/changelog
    $ poor-mans-gitbuild
    $ git push
    $ git push origin tag debian/2.6.3+200709292116+4450e59-3
    
    That first git-push may require a short explanation: without any arguments, git-push updates only the intersection of local and remote branches, so it would never push a new local branch (such as build above), but it updates all existing ones; thus, you cannot inadvertedly publish a local branch. Tags still need to be published explicitly.
    Hacking on the software Imagine: on a rainy Saturday afternoon you get bored and decide to implement a better way to tell mdadm when to start which array. Since you're a genius, it'll take you only a day, but you do make mistakes here and there, so what could be better than to use version control? However, rather than having a branch that will live forever, you are just creating a local branch, which you will not publish. When you are done, you'll feed your work back into the existing branches. Git makes branching really easy and as you may have spotted, the poor-mans-gitbuild script reserves an entire branch namespace for people like you:
    $ git checkout -b tmp/start-arrays-rework master
    
    Unfortunately (or fortunately), fixing this issue will require work on two branches, since the initramfs script and hook are maintained in a separate branch. There are (again) two ways in which we can (sensibly) approach this:
    • create two separate, temporary branches, and switch between them as you work.
    • merge both into the temporary branch and later cherry-pick the commits into the appropriate branches.
    I am undecided on this, but maybe the best would be a combination: merge both into a temporary branch and later cherry-pick the commits into two additional, temporary branches until you got it right, and then fast-forward the official branches to their tips:
    $ git merge master deb/initramfs
    $ editor debian/mdadm-raid                     #  
    $ git commit -s debian/mdadm-raid
    $ editor debian/initramfs/script.local-top     #  
    $ git commit -s debian/initramfs/script.local-top
    [many hours of iteration pass ]
    [  until you are done]
    $ git checkout -b tmp/start-arrays-rework-init master
      # for each commit $c in tmp/start-arrays-rework
      # applicable to the master branch:
    $ git cherry-pick $c
    $ git checkout -b tmp/start-arrays-rework-initramfs deb/initramfs
      # for each commit $c in tmp/start-arrays-rework
      # applicable to the deb/initramfs branch:
    $ git cherry-pick $c
    
    This is assuming that all your commits are logical units. If you find several commits which would better be bundled together into a single commit, this is the time to do it:
    $ git cherry-pick --no-commit <commit7>
    $ git cherry-pick --no-commit <commit4>
    $ git cherry-pick --no-commit <commit5>
    $ git commit -s
    
    Before we now merge this into the official branches, let me briefly intervene and introduce the concept of a fast-forward. Git will "fast-forward" a branch to a new tip if it decides that no merge is needed. In the above example, we branched a temporary branch (T) off the tip of an official branch (O) and then worked on the temporary one. If we now merge the temporary one into the official one, Git determines that it can actually squash the ancestry into a single line and push the official branch tip to the same ref as the temporary branch tip. In cheap (poor man's), ASCII notation:
    - - - O             >> merge T >>     - - - = - - OT
             - - T      >>  into O >>
    
    This works because no new commits have been made on top of O (if there would be any, we might be able to rebase, but let's not go there quite yet; rebasing is how you shoot yourself in the foot with Git). Thus we can simply do the following:
    $ git checkout deb/initramfs
    $ git merge tmp/start-arrays-rework-initramfs
    $ git checkout master
    $ git merge tmp/start-arrays-rework-init
    
    and test/build/push the result. Or well, since you are not an mdadm maintainer (We^W I have open job positions! Applications welcome!), you'll want to submit your work as patches via email:
    $ git format-patch -s -M origin/master
    
    This will create a number of files in the current directory, one corresponding for each commit you made since origin/master. Assuming each commit is a logical unit, you can now submit these to an email address. The --compose option lets you write an introductory message, which is optional:
    $ git send-email --compose --to your@email.address <file1> <file2> < >
    
    Once you've verified that everything is alright, swap your email address for the bug number (or the pkg-mdadm-devel list address). Thanks (in advance) for your contribution! Of course, you may also be working on a feature that you want to go upstream, in which case you'd probably branch off upstream-patches (if it depends on a patch not yet in upstream's repository), or upstream (if it does not):
    $ git checkout -b tmp/cool-feature upstream
    [ ]
    
    when a new upstream version comes around After a while, upstream may have integrated your patches, in addition to various other changes, to give birth to mdadm-2.6.4. We thus first fetch all the new refs and merge them into our upstream branch:
    $ git fetch upstream-repo
    $ git checkout upstream
    $ git merge upstream-repo/master
    
    we could just as well have executed git-pull, which with the default configuration would have done the same; however, I prefer to separate the process into fetching and merging. Now comes the point when many Git people think about rebasing. And in fact, rebasing is exactly what you should be doing, iff you're still working on an unpublished branch, such as the previous tmp/cool-feature off upstream. By rebasing your branch onto the updated upstream branch, you are making sure that your patch will apply cleanly when upstream tries it, because potential merge conflicts would be handled by you as part of the rebase, rather than by upstream:
    $ git checkout tmp/cool-feature
    $ git rebase upstream
    
    What rebasing does is quite simple actually: it takes every commit you made since you branched off the parent branch and records the diff and commit message. Then, for each diff/commit_message pair, it creates a new commit on top of the new parent branch tip, thus rewrites history, and orphans all your original commits. Thus, you should only do this if your branch has never been published or else you would leave people who cloned from your published branch with orphans.
    If this still does not make sense, try it out: create a (source) repository, make a commit (with a meaningful commit message), branch B off the tip, make a commit on top of B (with a meaningful message), clone that repository and return to the source repository. There, checkout the master, make a commit (with a ), checkout B, rebase it onto the tip of master, make a commit (with a ), and now git-pull from the clone; use gitk to figure out what's going on.
    So you should almost never rebase a published branch, and since all your branches outside of the tmp/* namespace are published on git.debian.org, you should not rebase those. But then again, Pierre actually rebases a published branch in his workflow, and he does so with reason: his patches branch is just a collection of branches to go upstream, from which upstream cherry-picks or which upstream merges, but which no one tracks (or should be tracking). But we can't (or at least will not at this point) do this for our feature branches (though we could treat upstream-patches that way), so we have to merge. At first, it suffices to merge the new upstream into the long-living build branch, and to call poor-mans-gitbuild, but if you run into merge conflicts or find that upstream's changes affect the functionality contained in your feature branches, you need to actually fix those. For instance, let's say that upstream started providing md.txt (which I previously provided in the deb/docs branch), then I need to fix that branch:
    $ git checkout deb/docs
    $ git rm md.txt
    $ git commit -s
    
    That was easy, since I could evade the conflict. But what if upstream made a change to Makefile, which got in the way with my configuration file location change? Then I'd have to merge upstream into deb/conffile-location, resolve the conflicts, and commit the change:
    $ git checkout deb/conffile-location
    $ git merge upstream
    CONFLICT!
    $ git-mergetool
    $ git commit -s
    
    When all conflicts have been resolved, I can prepare a new release, as before:
    $ git checkout master
    $ dch -i
    $ dpkg-parsechangelog   sed -ne 's,Version: ,,p'
    2.6.3+200709292116+4450e59-3
    # git commit -s debian/changelog
    $ poor-mans-gitbuild
    # git push
    $ git push origin tag debian/2.6.3+200709292116+4450e59-3
    
    Note that Git often appears smart about commits that percolated upstream: since upstream included the two commits in upstream-patches in his 2.6.4 release, my upstream-patches branch got effectively annihilated, and Git was smart enough to figure that out without a conflict. But before you rejoice, let it be told that this does not always work.
    Creating and using a maintenance branch Let's say Debian "lenny" is released with mdadm 2.7.6-1, then:
    $ git checkout -b maint/lenny debian/2.7.6-1
    
    You might do this to celebrate the release, or you may wait until the need arises. We've already left the domain of reality ("lenny" is not yet released), so the following is just theory. Now, assume that a security bug is found in mdadm 2.7.6 after "lenny" was released. Upstream is already on mdadm 2.7.8 and commits deadbeef and c0ffee fix the security issue, then you'd cherry-pick them into the maint/lenny branch:
    $ git checkout upstream
    $ git pull
    $ git checkout maint/lenny
    $ git cherry-pick deadbeef
    $ git cherry-pick c0ffee
    
    If there are no merge conflicts (which you'd resolve with git-mergetool), we can just go ahead to prepare the new package:
    $ dch -i
    $ dpkg-parsechangelog   sed -ne 's,Version: ,,p'
    2.7.6-1lenny1
    $ git commit -s debian/changelog
    $ poor-mans-gitbuild
    $ git push origin maint/lenny
    $ git push origin tag debian/2.7.6-1lenny1
    
    Future directions It should be trivial to create the Debian source package directly from the repository, and in fact, in response to a recent blog post of mine on the dispensability of pristine upstream tarballs, two people showed me their scripts to do it. My post also caused Joey Hess to clarify his position on pristine tarballs, before he went out to implement dpkg-source v3. This looks very promising. Yet, as Romain argues, there are benefits with simple patch management systems. Exciting times ahead! In addition to creating source packages from version control, a couple of other ideas have been around for a while:
    • create debian/changelog from commit log summaries when you merge into the build branch.
    • integrate version control with the BTS, bidirectionally:
      • given a bug report, create a temporary branch and apply any patches found in the bug report.
      • upon merging the temporary branch back into the feature branch it modifies, generate a patch, send it to the BTS and tag the bug report + pending patch.
    And I am sure there are more. If you have any, I'd be interested to hear about them!
    Wrapping up I hope this post was useful. Thank you for reading to the end, this was probably my longest blog post ever. I want to thank Pierre Habouzit, Johannes Schindelin, and all the others on the #git/freenode IRC channel for their tutelage. Thanks also to Manoj Srivastava, whose pioneering work on packaging with GNU arch got me started on most of the concepts I use in the above. And of course, the members of the the vcs-pkg mailing list for the various discussions on this subject, especially those who participated in the thread leading up to this post. Finally, thanks to Linus and Junio for Git and the continuously outstanding high level of support they give. If you are interested in the topic of using version control for distro packaging, I invite you to join the vcs-pkg mailing list and/or the #vcs-pkg/irc.oftc.net IRC channel. NP: Aphex Twin: Selected Ambient Works, Volume 2 (at least when I started writing )

    29 September 2007

    Joey Hess: foo feed

    I've added a foo feed to my blog. Stuff posted there won't show up in my main blog feed, so it probably won't go across your eyeballs. I've not been blogging a lot lately, because it often seems not worth wasting bandwidth for random, half-thought-out, or unimportant stuff, and often not worth the effort to try to synthesise something interesting out of it all. I'll probably use the foo feed for such things, as well as for replies to blog posts that don't add a lot of substance. Just grist for the google mill. Maybe that'll mean it becomes the interesting feed that everyone reads.. (PS, am I the only DD on Planet Debian who occasionally gets the heebie-jeebies about my every post scrolling across uncountable computer screens as part of that screensaver? Hi, you. Yes, you, the one reading this in a large-font crawl across your screen right now, who has no idea who I am, or even that there's a person typing this.)

    28 September 2007

    Adrian von Bidder: I just don't git it.

    A revision control system where just fetching the latest source from a specific branch of a project takes quite a bit of discussion on IRC is just broken. Yes, I got there in the end (thanks to all who helped or at least made fun of me when I later had to solve a small autoconf issue!), and yes, the instructions on the web I tried to follow were broken which is not git's fault, but I just like the user interface of svn co http://wherever/repository/branch: a single URL specifying the repository and the branch, a single command to fetch what I want. Compared to at least two separate commands with git (clone and checkout) with several commandline arguments. Of course, git gives me much more than just the that single branch, and its distributed approach is great -- this is just a small rant about the user interface which could be more newbie-friendly for the (probably quite big) number of people familiar with the rcs / cvs / svn familiy of version control systems. After all, I didn't want to seriously work with git at this time, but just do the X developers a favor (after ranting at them a few days before) and quickly test the latest version.

    26 September 2007

    Wouter Verhelst: Live!

    My brother and me, we've been maintaining the website for the Jozef Pauly Ensemble since a few years. I'd written some stuff in PHP so that a few things could be automated, but it wasn't much more than a glorified SSI setup, with a random picture at the home page, a calendar page that would automatically strike out past events, and some semi-homebrewn language negotiation support based on my accept-to-gettext.inc file that I wrote a few years ago (and which apparently has become quite popular in the mean time—even with the bug in that it requires you to set a charset, which is totally unnecessary). I had tried to set it up so that people could easily modify the site: everything was stored in subversion, and I made people use TortoiseSVN to make a checkout, explaining them how to safely use it, and providing a bunch of page templates, but that was still too difficult. Over the past year, I've been off and on working on replacing the whole setup with something based on Drupal, and today we've gone live. It's nothing too spectacular—just the default theme with some non-default colors and a few extra non-default modules—but at least I won't be the bottleneck for doing updates anymore; and stuff which used to run separately (forum, guest book, a few other things) are now nicely integrated into the main site. Isn't that nice.

    11 September 2007

    Michael Prokop: git-server for the poor: git-update-server-info, rsync and remote repository

    I was working on the integration of live-initramfs for grml in the last few days. As the Debian maintainers of live-initramfs switched from svn to git and I contributed several patches I had to deal with git as well. Thanks to my personal VCS hero gebi I learned some cute tricks for working with git. One very nice tip is the ‘git-server for the poor’, which is pretty simple to use and set up as soon as you know what to do. ;-) As there isn’t that much documentation regarding this issue on the net yet I’ll provide the necessary steps here: On the server side (where you are running a webserver) you just need a directory for serving via HTTP:
    % mkdir -p /var/www/grml/git/live-initramfs.git
    
    On the client side check out the original repository, create a branch, edit what you want to and finally put it on the server so upstream can grab it:
    % git clone git://git.debian.org/git/users/daniel/live-initramfs.git
    % cd live-initramfs
    % git checkout -b cool_new_feature
    Switched to a new branch "cool_new_feature"
    % $EDITOR $FILE(S)_YOU_WANT_TO_CHANGE
    % git commit -a
    % git-update-server-info
    % rsync -az .git/* server:/var/www/grml/git/live-initramfs.git/
    
    Now upstream (or you) can work with the remote git repository in the local repository and can refer to it through a name:
    % git remote add prokop http://grml.org/git/live-initramfs.git
    % git remote update
    
    Let’s checkout what we have on the remote repository available:
    % git remote show prokop
    * remote prokop
      URL: http://grml.org/git/live-initramfs.git
      Tracked remote branches
        cool_new_feature master
    % git diff master..prokop/cool_new_feature
    
    Finally do with it whatever you like, for example:
    % git merge master prokop/cool_new_feature
    ... or ...
    % git merge $COMMIT_ID
    ... or ...
    % git co master
    % git merge prokop/cool_new_feature
    ... or ...
    % git checkout -b my_test_branch prokop/cool_new_feature
    ... or ...
    % git-merge
    ... or ...
    % git-cherry-pick
    ... or ...
    
    This process might be very handy for working together with upstream (hi, panthera :-)) JFTR: I’m tracking useful ressources for working with git at my del.icio.us page.

    5 September 2007

    Ian Murdock: Where s the war?

    Jim Grisanzio: “What I find interesting is that Matt uses the phrase ‘we’re getting Solaris versus Linux’ to point to an article titled ‘OpenSolaris will challenge Linux says Sun’ which is actually an abridged article from the more aptly titled ‘Sun: Coders key to Solaris’ rise’ published last week. I blogged about that original article because I loved the quote in there about the OpenSolaris Community. But the version that has people all worked up today is missing eight paragraphs of text from the original. Why? Read both of them and you’ll see the clear difference in tone. And why all the wild headline changes, too? Even if you read the version Matt points to you’d be hard pressed to find anything in the article to substantiate the headline. I mean, really, this is silly. Sun’s Ian Murdock and Marc Hamilton were talking about how the OpenSolaris community is growing, how the technology is improving, and some of the plans we are kicking around to improve things. That’s pretty much it. So, where’s the war here?”

    16 August 2007

    Eddy Petri&#537;or: too much to do, too little time

    Short update:
    ritter:/home/eddy# chroot /data/chroots/armel-root-fs/
    Illegal instruction
    ritter:/home/eddy# uname -a
    Linux ritter 2.6.18-4-ixp4xx #1 Sun Aug 5 19:53:40 EEST 2007 armv5tel GNU/Linux

    9 August 2007

    Biella Coleman: Posts for the BCBS Mill

    As many may recall, I wrote a couple of scathing posts about my less than stellar experiences with Blue Cross Blue Shield of New Jersey/ So, I am happy that people are finding the post and leaving their own horror stories. While it sucks that they have had problems, it is key to splatter these stories over the net. It it is a good indication that if I start my BCBS complain site, the name and domain which already exist (and the name is quite clever, imho), it will flourish. I am still on the fence about it as I am “giving” BCBS another chance to come through with the payment. I am in fact about to write my first appeal letter and send it off hopefully this weekend. In another month I should know whether they approve my claim or whether I will have to move to the second appeal process, which apparently goes to an external review board. But hopefully the posts and comments will keep coming as they are good grist for the BCBS mill.

    Michael Janssen: UI Peeves: Locking, Proximity and Purpose

    I have had, on occasion in the past, a reason to use the wonderful TortoiseSVN software. It is, by all standards, a really great solution for someone wanting to use SVN in a MS Windows environment, and uses the official svn client in order to leverage open source as much as possible. Recently I have been using it a bit more as I work at Honeywell as a programmer. I've come across a couple things that bug me about the interface.

    The first is that some actions inexplicably lock the place that initiates that action. The best example I have of this is when I am looking at the window for an Update, and want to see what happened in the log, I click the button to open the log, and I can't use the window while the log downloads. Sometimes this can be an issue because the server is pretty slow at producing logs for some reason (it's beyond me, and NotMyProblem(tm) because I'm not in charge of the admin). This makes it irritating because I can't inspect other files while the log is downloading. Strangely, the server actually will return other requests quickly, like the request needed to see the diff between the working copy and the tree. It would be much better if the windows were separate - they're not related to each other in effect, so the locking of the initial window is completely useless. I could have called up the log from another action, that would leave the update window perfectly usable, so I know it's possible.

    The second problem that I have run across more than once relates to the proximity of actions in the right click menu while committing a change. Take a look at the screenshot of this menu.
    TortoiseSVN commit context menu

    There have been many times when using this window that I realize that I forgot to add a file that I need to commit, so I right click on the file and move down to the "Add" menu item, only to miss and click on the "Delete" item. "Delete", when used on a unversioned file, performs a windows delete, causing me to curse at the (now missing) entry in the commit log and go running to the recycle bin to retrieve this temporarily lost file. These two options in the context menu are entirely too close to each other. The "Delete" and "Add" actions have completely opposite meanings and effects, and having the program do exactly the opposite of what you expect is what I consider to be a Very Bad Thing. I would move the "Add" action up to the top of the list (it is, by far, the most common reason for me to use the context menu), or at least place another menu item in between.

    I'm feeling like I'm being very unhelpful here, complaining about these issues in an open source project and not producing a patch to fix these issues. I may produce one in the near future - unfortunately when I'm not at Honeywell, I don't really have a Windows development environment setup.

    Comments: (1) Trackbacks: (0)

    Comments
    1. JD: The reason diffs are quick is because svn keeps a copy of the original file in the checkout, so diffs and reverts don't need to hit the server.
    Trackbacks
    1. No Trackbacks

    15 July 2007

    Eric Dorland: git'ing it on

    A hot topic this past DebConf7 was git. I've bought into the hype, so I decided to take the plunge and move my Subversion repositories to it. A lot of people seem to be willing to part with their history when making the move, but I'm some what irrationally attached to it.

    Most of my Debian packages are in one big SVN repo, which used to be one big CVS repo (I used cvs2svn to move). So I decided to pull apart each source package into its own git repository. I started with git svn clone like so:

    $ git svn clone -A authors --trunk=trunk/libclass-makemethods-perl \
      --branches=branches/libclass-makemethods-perl/upstream \
      --tags=tags/libclass-makemethods-perl --no-metadata \
      file:///home/svn/debian libclass-makemethods-perl
    


    And this gives a git repo that can track an SVN repo. But I want to go all the way, no turning back. So I made a little script to clean up this repo called clean-git-svn:

    #!/bin/sh -e
    tags= git branch -r   egrep 'tags/[^@]+$' 
    echo "$tags"   perl -ne \
      'chomp($_); my $head = $_; s,\s+tags,debian,g; print "git tag $_ $head^\n"'
    for i in $tags ; do echo "git branch -r -d $i"; done
    upstream_tags= git branch -r   egrep ' +[0-9][^@]+$' 
    echo "$upstream_tags"   perl -ne \
      'chomp($_); s,\s+,,g; print "git tag upstream/$_ $_^\n"'
    for i in $upstream_tags ; do echo "git branch -r -d $i"; done
    echo "git branch upstream current"
    echo "git branch -r -d current"
    echo "git branch -r -d trunk"
    


    This will output a bunch of git commands that will make this a more "gitified" repo. I make no guarantees this will work, you should probably hand check your history with gitk to make sure this won't screw anything up. If your the part you're converting also came up from CVS, you'll probably have a bit of a mess on your hands that will need more manual cleanup. gitk is really an amazing visualization tool and can help a lot here. Once you're satisfied just pipe it into /bin/sh. Since git svn mostly can't track where you merged in your SVN repo, make sure you merge the upstream branch into master as soon as you can. It will save you a lot of conflicts later, trust me.

    One thing I miss from svn is svn export. Does an equivalent command exist in git? You would think there would be an option you could pass to git clone to do this but I can't seem to find anything.

    Next.

    Previous.